#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
int main()
{

  pid_t id=fork();
  if(id==0)
  {
    //child
    printf("i am child process,pid:%d,ppid:%d\n",getpid(),getppid());
    sleep(5);
    exit(1);
  }
  else
  {
    //parent
    while(1)
    {
      printf("i am parent process,pid:%d,ppid:%d\n",getpid(),getppid());
      sleep(1);
    }
  }

  //int flag=0;
  //int a=1;
  //while(1)
  //{
  //  printf("当前a的值是：%d running flag is:%d\n",a+=1,flag++);
  //  sleep(1);
  //}


  return 0;
}



